"""--------------------------------------------------------------------------------------------------
Filename:   waformEditor.py
Author:     Chris Chester
Date:       15 Feb 2013
Description:
    Module for altering the incoming data from the hardware to implement peak detection and other
    such alterations.
--------------------------------------------------------------------------------------------------"""

import numpy 
from decimal import Decimal
#===============================================================================
# CLASS: WaveEditor
#    Contains editors for the waveforms
#===============================================================================
class WaveEditor():
    def __init__(self, app):
        # Save references to main objects
        self.app = app
        
        self.ch1PeakPos = 0
        self.ch2PeakPos = 0

        
    def peakDetection(self):
        #self.meanCh1 = numpy.mean(self.ydataCh1) 
        #self.meanCh1 = numpy.mean(self.ydataCh1) 
        return 1
        
    def sharpen1(self,emg):
        temp = emg - 1000
        temp = temp * 2
        emgOut = temp + 2000
        
        #emgOut = (emg - 800)*7
        
        return emgOut
    def sharpen2(self,emg):
        temp = emg - 2000
        temp = temp * 2
        emgOut = temp + 1000
        
        #emgOut = (emg - 800)*7
        
        return emgOut
    